# $Id: PKGBUILD 66179 2012-02-23 02:31:15Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
#Maintainer: Ben Mazer <blm@groknil.org>

pkgname=pychecker
pkgver=0.8.19
pkgrel=2
pkgdesc="Python code checker"
arch=('any')
url="http://pychecker.sourceforge.net"
license=('custom')
depends=('python2')
source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz
        python27.patch)
md5sums=('c37182863dfb09209d6ba4f38fce9d2b'
         '5c48ee4be37443ac73cce88bbf6b06ea')

build() {
  cd $srcdir/$pkgname-$pkgver
#  patch -Np1 -i $srcdir/python27.patch
  python2 setup.py install --root=$pkgdir
  sed -i "s:$pkgdir::" $pkgdir/usr/bin/pychecker
  install -D -m 644 COPYRIGHT $pkgdir/usr/share/licenses/$pkgname/COPYRIGHT
  sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
         -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
         $(find $pkgdir -name '*.py')
}
